package com.example.dynamicdatasource.service;

import com.example.dynamicdatasource.annotation.DataSource;
import com.example.dynamicdatasource.entities.User;
import com.example.dynamicdatasource.mapper.TestMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author mqb
 * @date 2021/8/9 20:12
 */
@Service
public class TestService {

    @Resource
    TestMapper testMapper;

    @DataSource("test")
    public User selectOne(Long id){
        return testMapper.selectOne(id);
    }
}
